#include"subsetsum.h"
#include<math.h>
int subsetSum(int * setA,int sizeA,int kval){

    unsigned int maxCode = 1;
    unsigned int index = 0;
    // (2^sizeA) - 1
    // -通过函数来获取这个子集的个数
    maxCode = countSubSetNumber(sizeA);
    int total = 0;
    // -去除空集合
    for(index = 1;index < maxCode;index++){

        total += subsetnumEqual(setA,sizeA,kval,index);
    }
    return total;
}

unsigned int countSubSetNumber(int sizeA){

    unsigned int maxCode = 1;
    int index = 0;
    for(index = 0;index < sizeA;++index){

        maxCode*=2;
    }
    return maxCode;
}